<?php

/**
 * Description of groupReservationSizeSaveAction
\* www.teuker.nl - mail@teuker.nl
 * 
 * @author francisc
 */

class groupReservationSizeSaveAction extends sfAction {

    public function execute($request) {
        $size = $request->getParameter('size');

        if (is_numeric($size)) {
            $size = (int) $size;
            SqlEngineCore::get()->update(array(
                                    'table' => 'settings',
                                    'columns' => array(
                                        'group_size' => $size),
                                    'where' => array(
                                        'restaurant_id' => $this->getUser()->getAttribute('current_restaurant_id'))));

            $this->error = 0;
        }
        else {var_dump(is_int($size));
            $this->error = 1;
        }
    }
}
